async function loadText(){
    const url = '';
    const resp = await fetch(url);
    const reader =resp.body.getReader();
   
    const decoder = new TextDecoder();
    let remainChunk = new Uint8Array(0);
    for(;;){
        const {value,done} = await reader.read();
        if(done){
            break;
        }
        const lastIndex = value.lastIndexOf(10);// 数值10位置进行切分
        const chunk = value.slice(0, lastIndex + 1); // 截取本次数组
        // 以上一次未解析的内容长度 + 本次需要解析的长 = 需要初始化的字节数组长度
        const readChunk = new Uint8Array(remainChunk.length + chunk.length);
         // 从 0 开始，加载上一次未解析内容
        readChunk.set(remainChunk);
         // 从上一次未解析内容末尾开始，加载本次内容
        readChunk.set(chunk, remainChunk.length);
        remainChunk = value.slice(lastIndex + 1);
        const text = decoder.decode(readChunk);
        console.log(text);
    }
    
}

loadText();